<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'opportunityTeam.label', default: 'OpportunityTeam')}"/>
    <title>订单列表</title>
    <style>
     .hbreadcrumb{
        margin-top: 0px;
     }

    </style>
</head>

<body class="fixed-navbar fixed-sidebar">

<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>贷款管理系统</li>
                    <li class="active">
                        <span>订单管理</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                订单管理
                  <span style="margin: 0 5px; font-weight: normal;font-size: 12px;">${stage?.name}</span><span style="margin: 0 5px;font-weight: normal;font-size: 12px;">${status}</span>
            </h2>
        </div>
    </div>
</div>


<div class="content animate-panel">
    <div class="row">
        <div class="message alert alert-info hide" role="status" id="alert">

        </div>

        <g:form method="POST" action="index" name="form">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="button" id="search"><i class="fa fa-search"></i>查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn"><i
                                class="fa fa-times"></i>重置</button>

                    </div>
                    查询
                </div>
                
                <div id="reportStatus" style="display:none">
                    <input type="hidden" id="report" name="report">
                </div>
                <div class="panel-body seach-group">


                    <div class="col-md-3">
                        <input type="text" class="form-control" placeholder="业务编号" id="serialNumber" name="serialNumber"
                               value="${params?.serialNumber}">
                    </div>

                    <div class="col-md-3">
                      <input type="text" class="form-control" placeholder="柜员名称" id="user" name="user" value="${params?.user}">
                    </div>

                    <div class="col-md-3">
                        <input type="text" class="form-control" placeholder="借款人姓名" id="fullName" name="fullName"
                               value="${params?.fullName}">
                    </div>
                    <div class="col-md-3">
                        <input type="text" class="form-control" placeholder="借款人身份证号" id="idNumber" name="idNumber"
                               value="${params?.idNumber}">
                    </div>
                    <div class="col-md-3">
                        <input type="text" class="form-control" placeholder="借款人手机号" id="cellphone" name="cellphone"
                               value="${params?.cellphone}">
                    </div>
                    <div class="col-md-3">
                        <div class="input-group date form_datetime">
                            <span class="input-group-addon">
                                <span class="fa fa-calendar"></span>
                            </span>
                            <input title="开始时间" type="text" name="startTime" id="startTime" value="${params?.startTime}" readonly
                                   class="form-control daily-b" placeholder="开始时间">
                        </div>
                    </div>

                    <div class="col-md-3">
                        <div class="input-group date form_datetime">
                            <span class="input-group-addon">
                                <span class="fa fa-calendar"></span>
                            </span>
                            <input title="结束时间" type="text" name="endTime" id="endTime" placeholder="结束时间"
                                   value="${params?.endTime}" readonly class="form-control daily-b">
                        </div>
                    </div>
                    <div class="col-md-3">
                        <input type="text" class="form-control" placeholder="渠道" id="channel" name="channel"
                               value="${params?.channel}">
                    </div>
                    <div class="col-md-3">
                        <input type="text" class="form-control" placeholder="商户" id="merchant" name="merchant"
                               value="${params?.merchant}">
                    </div>
                    <div class="col-md-3">
                        <input type="text" class="form-control" placeholder="订单状态" id="status" name="status"
                               value="${params?.status}">
                    </div>




                </div>
            </div>
        </g:form>
    </div>

    <g:if test="${flash.message}">
        <div class="row">
            <div class="hpanel">
                <div class="panel-body">
                    <div class="alert alert-info" role="alert">${flash.message}</div>
                </div>
            </div>
        </div>
    </g:if>
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                全部订单
            </div>

            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <g:sortableColumn property="serialNumber" title="业务编号"></g:sortableColumn>
                            <g:sortableColumn property="serialNumber" title="柜员所属机构"></g:sortableColumn>
                            <g:sortableColumn property="serialNumber" title="客户经理"></g:sortableColumn>
                            <g:sortableColumn property="serialNumber" title="所属渠道"></g:sortableColumn>
                            <g:sortableColumn property="serialNumber" title="所属商户"></g:sortableColumn>
                            <g:sortableColumn property="serialNumber" title="产品类型"></g:sortableColumn>
                            <g:sortableColumn property="serialNumber" title="申请人"></g:sortableColumn>
                            <g:sortableColumn property="serialNumber" title="手机号"></g:sortableColumn>
                            <g:sortableColumn property="serialNumber" title="身份证号"></g:sortableColumn>
                            <g:sortableColumn property="serialNumber" title="申请金额"></g:sortableColumn>
                            <g:sortableColumn property="serialNumber" title="申请期限"></g:sortableColumn>
                            <g:sortableColumn property="serialNumber" title="创建时间"></g:sortableColumn>
                            <g:sortableColumn property="serialNumber" title="订单状态"></g:sortableColumn>

                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${opportunityList}">
                            <tr>
                                <td><g:link controller="bocOpportunity" action="show" id="${it?.id}" class="firstTd">${it?.serialNumber}</g:link></td>
                                <td>${it?.user?.account?.name}</td>
                                <td>${it?.user?.fullName}</td>
                                <td>${it?.account?.parent?.name}</td>
                                <td>${it?.account?.name}</td>
                                <td>${it?.product?.name}</td>
                                <td>${it?.fullName}</td>
                                <td>${it?.cellphone}</td>
                                <td>${it?.idNumber}</td>
                                <td>${it?.requestedAmount}</td>
                                <td>${it?.loanDuration}</td>
                                <td>${it?.createdDate}</td>
                                <td>${com.next.WorkflowInstance.findByOpportunity(it)?.status?.name}</td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="panel-footer">
                <div class="pagination">
                    <g:paginate total="${opportunityTeamCount ?: 0}" params="${params}"/>
                </div>
            </div>
        </div>
    </div>

</div>
<g:javascript>
    $("#search").click(function () {
        $("#reportStatus").css("display", "none")
        $("#report").val("");
        $("#form").submit()
    });

    $("#resetBtn").click(function () {
        $("#serialNumber").val("");
        $("#contact").val("");
        $("#fullName").val("");
        $("#user").val("");
        $("#city").val("");
        // $("#flexField").val("");
        $("#mortgageCertificateType").val("");
        $("#startTime").val("");
        $("#endTime").val("");
        // $("#estimatedTime").val("");
        // $("#contactLevel").val("");
        $("#actualAmountOfCreditMin").val("");
        $("#actualAmountOfCreditMax").val("");
        // $("#approvalStartTime").val("");
        // $("#approvalEndTime").val("");
        $("#channel").val("");
        $("#merchant").val("");
        $("#status").val("");
    })
    $("#download").click(function () {
        $("#reportStatus").css("display", "block")
        $("#report").val("yes");
        $("#form").submit()
    });
</g:javascript>
</body>
</html>
